#ifndef __ANN_MACROS_H__
#define __ANN_MACROS_H__

////////////////////////////////////////////////////////////////////////////////
// Macros
////////////////////////////////////////////////////////////////////////////////

//#define PLUGIN_DEBUG

// All data format (same for input data, output data and the weights)
#define INTEGER_SIZE	16
#define FLOAT_SIZE		32
#define IS_SIGNED		true // (1bit)
#define INT_P_SIZE		3
#define DEC_P_SIZE		28


// --- UNIVERSE ---

// Input size index (integer)
#define UN_S1_INPUT_SIZE_IDX			0
// Number of allocated inputs (integer)
//#define UN_S1_NB_ALLOCATED_IDX			16
// Input data list index (float list)
#define UN_S1_INPUT_IDX					16 //32

// Supervision flag (bit)
#define UN_K_SUPERVISION_FLAG_IDX		8
// Update flag (bit)
#define UN_K_UPDATE_FLAG_IDX			9
// Expected results size (integer)
#define UN_K_EXPECTED_SIZE_IDX			10
// Expected results (float list)
#define UN_K_EXPECTED_IDX				26

// Output size (index)
#define UN_S2_OUTPUT_SIZE_IDX 			0
// Output values (float list)
#define UN_S2_OUTPUT_IDX 				16


// --- INPUT TRANSFER ---

// Slot (integer)
//#define IT_K_DATA_REF_IDX				8


// --- AXON ---

// Signal index (float)
#define AX_S1_SIGNAL_IDX				0
// Sum index (float)
#define AX_S1_SUM_IDX					32
// Error index (float)
#define AX_S1_ERR_IDX					64

// Data flag (2 bits)
#define AX_K_DFLAG_IDX					8

// Input axon data ref (integer)
#define IA_S2_DATA_REF_IDX				0

// Output axon data ref (integer)
#define OA_S2_DATA_REF_IDX				16

// --- SYNAPSES ---

// Slot (integer)
#define SY_K_SLOT_IDX					8
// Weight (float)
#define SY_K_WEIGHT_IDX					24
// Delta Weight (float)
#define SY_K_D_WEIGHT_IDX				56
// Old Delta Weight (float)
#define SY_K_OLD_D_WEIGHT_IDX			88
// Data flag (2 bits)
#define SY_K_DFLAG_IDX					120


// --- DENDRITES ---

// Input size (integer)
#define DE_S1_INPUT_SIZE_IDX			0
// Input data list index (float list)
#define DE_S1_INPUT_IDX					16

// Data flag (2 bits)
#define DE_K_DFLAG_IDX					8

// Errors index (float list)
#define DE_S2_ERRORS_IDX				0


// --- MEMBRANE ---

// Threshold index (float)
#define ME_K_THRESHOLD_IDX				8
// Delta Threshold index (float)
#define ME_K_D_THRESHOLD_IDX			40
// Old Delta Threshold index (float)
#define ME_K_OLD_D_THRESHOLD_IDX		72
// Data flag (2 bits)
#define ME_K_DFLAG_IDX					104

// --- OUTPUT TRANSFER ---

//#define OT_K_SLOT_IDX					8


// *** VALUES ***

// Boolean values (of type char)
#define C_TRUE		"1"
#define C_FALSE	  	"0"

// Data flags
#define DFLAG_LGH	2

////////////////////////////////////////////////////////////////////////////////

// Error time counter (integer)
//#define AX_S1_ERR_CPT_IDX				64

// Synapse function code index (SC function size)
//#define SY_K_SC_FUNC_CODE_IDX			8
// Anchor flags
//#define SY_K_AXON_ANCH_FLAG_IDX			12
//#define SY_K_DEND_ANCH_FLAG_IDX			13

// Axon error (float)
//#define SY_K_AX_ERR_IDX					62
// Synapse life counter (integer)
//#define SY_K_CPT_IDX					94

// Last axon error (float)
//#define DE_K_ERR_IDX					8

// Last axon error time counter (integer)
//#define DE_K_ERR_CPT_IDX				40

// Weights index (float list)
//#define DE_K_WEIGHTS_IDX				8

// Post synaptic neuron's result feedback
//#define DE_K_POST_SYN_IDX				8

// Used input flags (bit list)
//#define DE_S2_USED_INPUT_IDX			0

#endif
